package com.young.common.client.log.configuration;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;

/**
 * 监控型日志参数
 *
 * @author imrookie
 * @date 2018/11/24
 */
@Configuration
@ConditionalOnProperty(
        name = "young.log.client.monitor-log.enable",
        havingValue = "true",
        matchIfMissing = false
)
@ConfigurationProperties(prefix="young.log.client.monitor-log")
public class MonitorLogConfiguration {
    private Boolean enable;//启用监控型日志
    private String defaultHandler;//默认的日志处理器
    private String[] logHandlerBeanNames;//日志处理器集合
    private Integer aopOrder;//日志切面顺序
    private String appName;//应用名
    private String monitorServerLogCollectUrl;//监控中心收集日志的url, 暂时作废

    @Override
    public String toString() {
        return "MonitorLogConfiguration{" +
                "enable=" + enable +
                ", defaultHandler='" + defaultHandler + '\'' +
                ", logHandlerBeanNames=" + Arrays.toString(logHandlerBeanNames) +
                ", aopOrder=" + aopOrder +
                ", appName='" + appName + '\'' +
                ", monitorServerLogCollectUrl='" + monitorServerLogCollectUrl + '\'' +
                '}';
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public String getDefaultHandler() {
        return defaultHandler;
    }

    public void setDefaultHandler(String defaultHandler) {
        this.defaultHandler = defaultHandler;
    }

    public String[] getLogHandlerBeanNames() {
        return logHandlerBeanNames;
    }

    public void setLogHandlerBeanNames(String[] logHandlerBeanNames) {
        this.logHandlerBeanNames = logHandlerBeanNames;
    }

    public Integer getAopOrder() {
        return aopOrder;
    }

    public void setAopOrder(Integer aopOrder) {
        this.aopOrder = aopOrder;
    }

    public String getMonitorServerLogCollectUrl() {
        return monitorServerLogCollectUrl;
    }

    public void setMonitorServerLogCollectUrl(String monitorServerLogCollectUrl) {
        this.monitorServerLogCollectUrl = monitorServerLogCollectUrl;
    }
}
